package com.dq.canal;

import com.dq.canal.client.CanalClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.Resource;

/**
 * @project: guli_parent
 * @ClassName: CanalApplication
 * @author: dq
 * @creat: 2022/9/25 15:53
 */
@SpringBootApplication
public class CanalApplication implements CommandLineRunner {
    @Resource
    private CanalClient client;

    public static void main(String[] args) {
        SpringApplication.run(CanalApplication.class,args);
    }

    /**
     * 这方法一直执行
     * @param args
     * @throws Exception
     */
    @Override
    public void run(String... args) throws Exception {
        client.run();
    }
}
